<?php

/**
 * ProductoPrecio form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ProductoPrecioForm extends BaseProductoPrecioForm
{
  public function configure()
  {
      //Eliminar los campos del formularios  created_at y updated_at
      unset (
        $this['created_at'],
        $this['updated_at'],
        $this['producto_id']

      );
      
      //$this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputText(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      
      //Cambiar a lista y su validador de los status Activo e Inativo 0/1
      $this->widgetSchema['is_impuesto'] = new sfWidgetFormChoice(array(
         'choices' => ProductoPrecio::$is_impuesto,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['is_impuesto'] = new sfValidatorChoice(array(
          'choices' => array_keys(ProductoPrecio::$is_impuesto),

      ));
      
     $this->widgetSchema['codigo'] = new sfWidgetFormInputText(array(),array('placeholder'=>'COD','size' =>"5", 'maxlength'=>"5",'style' => 'text-align:center;'));
     $this->widgetSchema['presentacion'] = new sfWidgetFormInputText(array(),array('placeholder'=>'Presentacion','size' =>"25", 'maxlength'=>"25"));
     $this->widgetSchema['precio'] = new sfWidgetFormInputText(array(),array('placeholder'=>'0.00','size' =>"15", 'maxlength'=>"15",'style' => 'text-align:right;'));
     $this->widgetSchema['puntos_costo'] = new sfWidgetFormInputText(array(),array('placeholder'=>'0','size' =>"5", 'maxlength'=>"5",'style' => 'text-align:center;'));
     $this->widgetSchema['puntos_regalo'] = new sfWidgetFormInputText(array(),array('placeholder'=>'0','size' =>"5", 'maxlength'=>"5",'style' => 'text-align:center;'));
      
      
      $this->widgetSchema->setLabels(array(
        'precio'           => 'Precio',
        'is_impuesto'      => 'Aplicar Impuesto',  
        'puntos_costo'     => 'Costo en Punto',
        'puntos_regalo'    => 'Puntos de Regalo',
        ));
      
  }
}
